package com.sdsy.controller;

import com.sdsy.util.CommonUtil;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.web3j.utils.Numeric;

import java.math.BigDecimal;
import java.math.BigInteger;


@Controller
public class IndexController {

    @GetMapping("/login")
    String welcome(Model model) {
        return "/login";
    }

    public static void main(String[] args) {
//        String input="0xa9059cbb0000000000000000000000005ad9d2ba8d16d20d60b94c131e389d6d7375fffe000000000000000000000000000000000000000000000000000000003b9aca00";
//        BigDecimal bigDecimal = new BigDecimal(0);
//        BigDecimal wei = new BigDecimal("100000000");
//        String c = "";
//        if (!CommonUtil.isNull(input)) {
//            String input_ = input.substring(74, input.length());
//            bigDecimal = new BigDecimal(Numeric.decodeQuantity("0x" + input_));
//            BigDecimal all = bigDecimal.divide(wei);
//            c = all.stripTrailingZeros().toPlainString();
//        }
//        System.out.println("c==============="+c);

//        BigInteger GAS_PRICE = BigInteger.valueOf(22_000_000_000L);
//        System.out.println(GAS_PRICE);

        BigDecimal a = new BigDecimal("90000").multiply(new BigDecimal("20000000000"));
        BigDecimal all = a.divide(new BigDecimal("1000000000000000000"), 6, BigDecimal.ROUND_HALF_UP);

        System.out.println(all.toString());
    }

    @GetMapping("/uploadExcel")
    String uploadExcel(Model model) {
        return "/uploadExcel";
    }


}
